<?php 
	if(isset($_POST['login']) && 
	$_POST['login']=="admin" &&
	isset($_POST['pass']) && 
	$_POST['pass']=="1234" &&
	(!isset($_COOKIE["Login"]) ||
	(isset($_COOKIE["Login"]) && $_COOKIE["Login"]==false))) {
		setcookie("Login", true, time() + (60*60*24));
		header("Refresh: 0; url=?s=login");
	}
	
	
	if(isset($_COOKIE["Login"]) && $_COOKIE["Login"]==true){
?>

<div>Jesteś zalogowany...</div>

<?php
	}else{
?>

<div>Logowanie
<br/><br/>
<form action="?s=login" method="post">
<table class="login">
	<tr>
		<td>
			<label for="login">Login</label>
			<input type="text" id="login" name="login" />
		</td>
		<td>
			<span class="link" onclick="loginTip()">(?)</span>
		</td>
	</tr>
	<tr>
		<td>
			<label for="pass">Hasło</label>
			<input type="password" id="pass" name="pass" />
		</td>
		<td>
			<span class="link" onclick="passTip()">(?)</span>
		</td>
	</tr>
	<tr>
		<td>
			<input type="submit" value="Zaloguj">
		</td>
	</tr>
</table>
</form>
</div>
<?php 
	}
?>